<?php
if (!(defined('IN_IA'))) 
{
	exit('Access Denied');
}

//用户地址管理
class Address_MxShopPage extends MobileLoginPage
{
    //我的地址
	public function main()
    {
        //获取令牌
        $token = $this->getToken();
		include $this->template();
	}

	//编辑地址
    public function edit()
    {

        global $_W, $_GPC;

        if($_W['ispost'])
        {
            //验证令牌
            if(empty($_GPC['token']) || !$this->checkToken($_GPC['token']))
            {
                show_json(0, '参数有误');
            }

            show_json(1, 666);
        }

        //获取令牌
        $token = $this->getToken();
        include $this->template();
    }

    /*
     * 获取我的地址
     * @param int $id 地址id（可选）
     * @return array
     * */
    protected function getAddress($id=0)
    {
        global $_W,$_GPC;

        $condition = '';
        $params = array();

        if($id !== 0)
        {
            $condition .= 'id=:id';
            $params[':id'] = $id;
        }

        //验证令牌
        if(empty($_GPC['token']) || !$this->checkToken($_GPC['token']))
        {
            show_json(0, '参数有误');
        }

        return array();
    }

}
